Skip to content

[codex] Improve NB2 masked edit guidance#43

Draft
yha9806 wants to merge 1 commit intomasterfrom
codex/v0-23-nb2-flower-quality
Draft

[codex] Improve NB2 masked edit guidance#43
yha9806 wants to merge 1 commit intomasterfrom
codex/v0-23-nb2-flower-quality

Conversation

@yha9806
Copy link
Copy Markdown
Contributor

@yha9806 yha9806 commented May 5, 2026

Summary

  • Updates the Gemini/NB2 masked edit adapter to render alpha masks as visible black/white reference masks before sending them to Gemini.
  • Tightens adapter prompt wording so the visible mask is treated as coordinate guidance, not output content.
  • Keeps the formal redraw API contract unchanged: callers still provide source crop + RGBA mask via inpaint_with_mask.

Validation

  • /opt/homebrew/bin/python3.11 -m pytest tests/test_mask_refine.py tests/test_layers_redraw.py tests/test_layers_redraw_crop_pipeline.py tests/test_layers_redraw_mask_aware.py tests/test_layers_redraw_quality_gates.py tests/test_layers_redraw_refinement.py tests/test_layers_redraw_strategy.py tests/test_layers_redraw_wire_contract.py tests/test_layers_v2_redraw.py tests/test_mcp_layers_redraw_advisory.py tests/test_redraw_review_contract.py tests/test_redraw_showcase_review.py tests/test_gemini_image_size.py tests/test_provider_edit_capabilities.py -> 143 passed, 5 warnings
  • git diff --check -> passed
  • Secret scan over changed files for Gemini/OpenAI key-shaped tokens -> no matches
  • Real NB2 probe on the roadside yellow flower crop reached formal redraw path and improved from gate-to-empty to constrained non-empty output: route_chosen=inpaint, refinement_applied=true, provider_requires_mask_for_edits=true, raw_scene_rejected=false, output alpha 0.0249% of canvas, bbox (2627, 1484, 2700, 1549).

Visual Risk

This is a provider-adapter quality improvement, not a full visual finish. The latest NB2 output no longer contaminates broad grass/vehicle regions and is localized to the flower footprint, but it can still render a chunky yellow patch because Gemini is not a native alpha-mask edit endpoint. Further work should tune scale/alpha extraction or use a provider with native masked edits for final showcase evidence.

Stacking

Stacked on PR #42 (codex/v0-23-redraw-replacement-contract). Keep this draft until #42 lands or retarget after merge.

@yha9806 yha9806 changed the base branch from codex/v0-23-redraw-replacement-contract to master May 5, 2026 11:49
@yha9806 yha9806 force-pushed the codex/v0-23-nb2-flower-quality branch from f669505 to 429d906 Compare May 5, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant